<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePositionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('position', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamp('time')->nullable()->comment('招聘时间');
            $table->unsignedInteger('uid')->nullable()->index()->comment('创建者');
            $table->unsignedInteger('assign')->nullable()->index()->comment('归属用户');
            $table->unsignedInteger('client_id')->nullable()->index()->comment('所属客户');
            $table->unsignedTinyInteger('emergency')->default(1)->comment('紧急程度 1紧急重要，优质客户 2紧急不重要，一般客户不3紧急不重要，新客户');
            $table->string('title')->comment('职位名称');
            $table->unsignedTinyInteger('region')->comment('工作地点');
            $table->unsignedTinyInteger('range')->comment('薪资范围');
            /*$table->string('category')->comment('职位类别');*///删除
            $table->string('reward')->comment('悬赏金');
            $table->unsignedInteger('hc')->default(0)->comment('需求量');
            $table->unsignedTinyInteger('state')->comment('需求状态');
            $table->unsignedTinyInteger('share')->default(1)->comment('是否共享');
            $table->tinyInteger('status')->default(1)->index()->comment('状态：-1删除，0禁用，1启用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('position');
    }
}
